﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    class PowerUpHealth : PowerUp
    {
        private static Texture2D _commonSprite;
        protected override Texture2D Sprite { get { return _commonSprite; } }

        public PowerUpHealth(Vector2 position) : base(position)
        {
            
        }
      
        public static void LoadContent(ContentManager contentManager)
        {
            _commonSprite = contentManager.Load<Texture2D>("sprites/1up_v2");
        }
  
        public override void HandleHit(IHittable other, GameTime colissionTime)
        {
            if (other is SpaceShip || other is Projectile)
            {
                if (GameplayScene.Lives < 3) GameplayScene.Lives++;               
            }
            GameObjectsManager.GetInstance().Destroy(this);
        }       
    }
}
